﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YeWuYDD.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS._2.YongHuGL.YeWuYDD" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script type="text/javascript">

        function save(type) {
            if (type == "tab1") {
                if (cmbYuanYWY.GetText() == "") {
                    alert("请选择原业务员。");
                    return;
                }
                if (cmbMuDiYWY.GetText() == "") {
                    alert("请选择目的业务员。");
                    return;
                }
            }
            else if (type == "tab2") {
                if (cmbJu.GetText() == "") {
                    alert("请选择行政区。");
                    return;
                }
                if (cmbJuMuDiYWY.GetText() == "") {
                    alert("请选择目的业务员。");
                    return;
                }
            }
            else if (type == "tab3") {
                if (cmbGLK.GetText() == "") {
                    alert("请选择管理块。");
                    return;
                }
                if (cmbGLKMuDiYWY.GetText() == "") {
                    alert("请选择目的业务员。");
                    return;
                }
            }
            else if (type == "tab4") {
                if (cmbGLK2.GetText() == "") {
                    alert("请选择管理块。");
                    return;
                }
                if (cmbGLK2YuanYWY.GetText() == "") {
                    alert("请选择原业务员。");
                    return;
                }
                if (cmbGLK2MuDiYWY.GetText() == "") {
                    alert("请选择目的业务员。");
                    return;
                }
            }
            if (confirm("您确认本次修改吗?")) {
                ASPxCallback1.PerformCallback(type);
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            if (state != "0") {
                alert(arr[2]);
            }
            else {
                alert(arr[2]);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            业务员调动
        </div>
        <div style="display: none;">
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        </div>
        <asp:UpdatePanel runat="server" ID="updatePanel1">
            <ContentTemplate>
                <dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" Width="100%">
                    <TabPages>
                        <dx:TabPage Text="用户业务员修改">
                            <ContentCollection>
                                <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                    <div style="text-align: center;">
                                        <table style="margin: 0 auto;">
                                            <tr>
                                                <td style="text-align: right;">原业务员名称：
                                                </td>
                                                <td>
                                                    <dx:ASPxComboBox ID="cmbYuanYWY" ClientInstanceName="cmbYuanYWY" runat="server" ValueType="System.String" Width="150px">
                                                    </dx:ASPxComboBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="text-align: right;">目的业务员名称：
                                                </td>
                                                <td>
                                                    <dx:ASPxComboBox ID="cmbMuDiYWY" ClientInstanceName="cmbMuDiYWY" runat="server" ValueType="System.String" Width="150px">
                                                    </dx:ASPxComboBox>
                                                </td>
                                            </tr>
                                        </table>
                                        <div>
                                            <hr />
                                            <table style="width: 100%;">
                                                <tr>
                                                    <td align="right">
                                                        <dx:ASPxButton ID="btnYongHu" ClientInstanceName="btnYongHu" runat="server" Text="修改" UseSubmitBehavior="false" AutoPostBack="false" ClientSideEvents-Click="function(s,e){save('tab1');}">
                                                        </dx:ASPxButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                        <dx:TabPage Text="行政区的业务员修改">
                            <ContentCollection>
                                <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                    <div style="text-align: center;">
                                        <table style="margin: 0 auto;">
                                            <tr>
                                                <td style="text-align: right;">行政区名称：
                                                </td>
                                                <td>
                                                    <dx:ASPxComboBox ID="cmbJu" ClientInstanceName="cmbJu" runat="server" ValueType="System.String" Width="220px">
                                                    </dx:ASPxComboBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="text-align: right;">目的业务员名称：
                                                </td>
                                                <td>
                                                    <dx:ASPxComboBox ID="cmbJuMuDiYWY" ClientInstanceName="cmbJuMuDiYWY" runat="server" ValueType="System.String" Width="220px">
                                                    </dx:ASPxComboBox>
                                                </td>
                                            </tr>
                                        </table>
                                        <div>
                                            <hr />
                                            <table style="width: 100%;">
                                                <tr>
                                                    <td align="right">
                                                        <dx:ASPxButton ID="btnJu" ClientInstanceName="btnJu" runat="server" Text="修改" UseSubmitBehavior="false" AutoPostBack="false" ClientSideEvents-Click="function(s,e){save('tab2');}">
                                                        </dx:ASPxButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                    </TabPages>
                </dx:ASPxPageControl>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
